<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of ItemCompraRepository
 *
 * @author felipe
 */
class App_Model_ItemCompraRepository {
    public function listarTodosAtivosPorCompra($coCompra) {
        $arrDbItemCompra = App_Model_Db_ItemCompra::build()->listarTodos(new Voitech_TO(array('co_compra'=>$coCompra,'st_ativo'=>'S')));
        $arrItemCompra = array();
        foreach($arrDbItemCompra as $row) {
            $obItemCompraMapper = new App_Model_ItemCompraMapper(new App_Model_ItemCompra(),$coCompra);
            $arrItemCompra[] = $obItemCompraMapper->carregar($row);
        }
        return $arrItemCompra;
    }
}